package com.tsd.core.exception;

import com.tsd.core.vo.ErrorCode;

/**
 * @ClassName: GlobalException
 * @Description: 全局异常类
 * @Author: Hillpool
 * @Date: 2024/5/13 9:17
 * @Version: 1.0
 */
public class GlobalException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private int code;

    public GlobalException(int code, String msssage) {
        super(msssage);
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public static GlobalException procError(String message) {
        return new GlobalException(ErrorCode.CODE_PROC_ERROR, message);
    }
}
